//
//  MKWAsyncTask.h
//  MilkyWayReader
//
//  Created by Quoc Dung Chu on 31/03/12.
//  Copyright (c) 2012 Milky Way Mobile. All rights reserved.
//

@class MKWPool;
typedef void (^ DoBeginAction) (void);
typedef void (^ DoProgressAction) (int );
typedef void (^ DoInBackgroundAction) (void);
typedef void (^ DoFinishAction) (void);
@class MKWAsyncTask;
@protocol MKWAsyncTaskDelegate <NSObject>
- (void) didMKWAsyncTaskFinshExecute: (MKWAsyncTask *) asyncTask;

@end

@interface MKWAsyncTask : NSObject

@property (nonatomic, unsafe_unretained) id < MKWAsyncTaskDelegate>   delegate;

+ (MKWAsyncTask *) createWithDoBeginAction: (DoBeginAction) doBeginAction_ 
                      doInBackgroundAction: (DoInBackgroundAction) doInBackgroundAction_
                          doProgressAction: (DoProgressAction) doProgressAction_ 
                            doFinishAction: (DoFinishAction) doFinishAction_ ;

- (void) execute;
@end
